/**
* 
* ====================================================================
*
* @author apov <apov@ymail.com>
*/ 
#pragma once

#include <BaseDefine.h>
#include <string>
#include <vector>

class DBSession;
/**
* @class DBError
*  - 
*/ 
class DBError{
public:	
	virtual int set_error( DBSession* session, void* data, \
		const char* error_query = 0, const char* error_method = 0, 
		const int error_line = 0 ) = 0;	

	virtual bool isDisconnect() = 0;	

	const char* getMethod();
	const char* getQuery();
	const char* getMsg( size_t idx );
	const char* getState();
	int getErrorCode();	

	size_t size();

	DBError();
	virtual ~DBError();

protected:
	void reset();
	 
	std::string error_method_;
	std::string error_query_;
	std::string error_msg_;
	std::string error_state_;

	int error_code_;
	bool disconnect_;	

private:	
};
